package com.yfj.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yfj.dao.ManagerDao;
import com.yfj.dao.StudentDao;
import com.yfj.dao.TeacherDao;
import com.yfj.entity.People;
import com.yfj.service.IndexService;

@Service
public class IndexServiceImpl implements IndexService {
	
	@Autowired
	private ManagerDao managerDao;
	@Autowired
	private TeacherDao teacherDao;
	@Autowired
	private StudentDao studentDao;

	@Override
	public People login(long id,String identity) {
		People p=null;
		if("manager".equals(identity)) {
			p=managerDao.loginQuery(id);
		}else if("teacher".equals(identity)) {
			p=teacherDao.loginQuery(id);
		}else if("student".equals(identity)) {
			p=studentDao.loginQuery(id);
		}
		return p;
	}

}
